
#****************************************************************************************************
# File Start!
#***************************************************************************************************/

#*
 #
 #  Copyright (c) 2024-2025 by flechazo. All rights reserved.
 #
 # Author : CarlChai LinFeng Chai flechazo
 # Website: flechazo.mba
 #
 # Change Logs:
 # Date           Author       Notes
 # 2025-06-14     cc          the first version
 #
#/

#****************************************************************************************************
# Include
#***************************************************************************************************/

from command.command_cfg import *

#****************************************************************************************************
# Define
#***************************************************************************************************/

#****************************************************************************************************
# Type Define
#***************************************************************************************************/

#****************************************************************************************************
# Global Variable
#***************************************************************************************************/

GLOBAL_DATABASE = {
    "KEYS" : {
        "修饰键": ["ctrl", "alt", "shift", "win"],
        "功能键": [f"f{i}" for i in range(1, 13)],
        "字母键": [chr(i) for i in range(ord('a'), ord('z')+1)],
        "数字键": [str(i) for i in range(10)],
        "符号键": ["`", "-", "=", "[", "]", "\\", ";", "'", ",", ".", "/"],
        "特殊键": ["space", "enter", "tab", "backspace", "delete", "insert", "home", "end", "pageup", "pagedown"],
        "方向键": ["up", "down", "left", "right"],
        "小键盘": ["num0", "num1", "num2", "num3", "num4", "num5", "num6", "num7", "num8", "num9", 
                    "num+", "num-", "num*", "num/", "num.", "numenter"],
        "媒体键": ["volume up", "volume down", "volume mute", "play", "pause", "next", "previous"],
    },
    "ACTIONS" : {
        # 系统控制
        "系统控制": [
            {"name": "打开任务管理器", "command": "taskmgr", "func": command_cfg_execute_action_OpenTaskManager},
            {"name": "打开控制面板", "command": "control", "func": command_cfg_execute_action_OpenControlPanel},
            {"name": "打开运行", "command": "win+r", "func": command_cfg_execute_action_OpenRun},
            {"name": "打开文件资源管理器", "command": "explorer", "func": command_cfg_execute_action_OpenExplorer},
            {"name": "打开计算器", "command": "calc", "func": command_cfg_execute_action_OpenCalculator},
            {"name": "打开记事本", "command": "notepad", "func": command_cfg_execute_action_OpenNotepad},
            {"name": "打开画图", "command": "mspaint", "func": command_cfg_execute_action_OpenPaint},
            {"name": "打开命令提示符", "command": "cmd", "func": command_cfg_execute_action_OpenCMD},
            {"name": "打开PowerShell", "command": "powershell", "func": command_cfg_execute_action_OpenPowerShell},
        ],
        # 窗口控制
        "窗口控制": [
            {"name": "最小化当前窗口", "command": "minimize_window", "func": command_cfg_execute_action_MinimizeWindow},
            {"name": "最大化当前窗口", "command": "maximize_window", "func": command_cfg_execute_action_MaximizeWindow},
            {"name": "关闭当前窗口", "command": "close_window", "func": command_cfg_execute_action_CloseWindow},
            {"name": "切换窗口", "command": "alt_tab", "func": command_cfg_execute_action_AltTab},
        ],
        # 浏览器操作
        "浏览器操作": [
            {"name": "打开Chrome", "command": "chrome", "func": command_cfg_execute_action_OpenChrome},
            {"name": "打开默认浏览器", "command": "default_browser", "func": command_cfg_execute_action_OpenDefaultBrowser},
        ],
        # 系统功能
        "系统功能": [
            {"name": "显示桌面", "command": "show_desktop", "func": command_cfg_execute_action_ShowDesktop},
            {"name": "锁定计算机", "command": "lock_computer", "func": command_cfg_execute_action_LockComputer},
            {"name": "切换输入法", "command": "switch_input", "func": command_cfg_execute_action_SwitchInput},
            {"name": "截图", "command": "screenshot", "func": command_cfg_execute_action_Screenshot},
        ],
        # 音量控制
        "音量控制": [
            {"name": "静音", "command": "volume_mute", "func": command_cfg_execute_action_VolumeMute},
            {"name": "增加音量", "command": "volume_up", "func": command_cfg_execute_action_VolumeUp},
            {"name": "降低音量", "command": "volume_down", "func": command_cfg_execute_action_VolumeDown},
        ],
        # 鼠标移动控制
        "鼠标移动控制": [
            {"name": "鼠标向上移动(小)", "command": "mouse_up_small", "func": command_cfg_execute_action_MouseUpSmall},
            {"name": "鼠标向下移动(小)", "command": "mouse_down_small", "func": command_cfg_execute_action_MouseDownSmall},
            {"name": "鼠标向左移动(小)", "command": "mouse_left_small", "func": command_cfg_execute_action_MouseLeftSmall},
            {"name": "鼠标向右移动(小)", "command": "mouse_right_small", "func": command_cfg_execute_action_MouseRightSmall},
            
            {"name": "鼠标向上移动(中)", "command": "mouse_up_medium", "func": command_cfg_execute_action_MouseUpMedium},
            {"name": "鼠标向下移动(中)", "command": "mouse_down_medium", "func": command_cfg_execute_action_MouseDownMedium},
            {"name": "鼠标向左移动(中)", "command": "mouse_left_medium", "func": command_cfg_execute_action_MouseLeftMedium},
            {"name": "鼠标向右移动(中)", "command": "mouse_right_medium", "func": command_cfg_execute_action_MouseRightMedium},
            
            {"name": "鼠标向上移动(大)", "command": "mouse_up_large", "func": command_cfg_execute_action_MouseUpLarge},
            {"name": "鼠标向下移动(大)", "command": "mouse_down_large", "func": command_cfg_execute_action_MouseDownLarge},
            {"name": "鼠标向左移动(大)", "command": "mouse_left_large", "func": command_cfg_execute_action_MouseLeftLarge},
            {"name": "鼠标向右移动(大)", "command": "mouse_right_large", "func": command_cfg_execute_action_MouseRightLarge},
        ],
        # 鼠标点击控制
        "鼠标点击控制": [
            {"name": "鼠标左键点击", "command": "mouse_left_click", "func": command_cfg_execute_action_MouseLeftClick},
            {"name": "鼠标右键点击", "command": "mouse_right_click", "func": command_cfg_execute_action_MouseRightClick},
            {"name": "鼠标双击", "command": "mouse_double_click", "func": command_cfg_execute_action_MouseDoubleClick},
            {"name": "鼠标中键点击", "command": "mouse_middle_click", "func": command_cfg_execute_action_MouseMiddleClick},
        ],
        # 鼠标拖拽控制
        "鼠标拖拽控制": [
            {"name": "鼠标左键拖拽开始", "command": "mouse_drag_start", "func": command_cfg_execute_action_MouseDragStart},
            {"name": "鼠标左键拖拽结束", "command": "mouse_drag_end", "func": command_cfg_execute_action_MouseDragEnd},
            {"name": "鼠标右键拖拽开始", "command": "mouse_right_drag_start", "func": command_cfg_execute_action_MouseRightDragStart},
            {"name": "鼠标右键拖拽结束", "command": "mouse_right_drag_end", "func": command_cfg_execute_action_MouseRightDragEnd},
        ],
        # 鼠标滚轮控制
        "鼠标滚轮控制": [
            {"name": "鼠标滚轮向上", "command": "mouse_wheel_up", "func": command_cfg_execute_action_MouseWheelUp},
            {"name": "鼠标滚轮向下", "command": "mouse_wheel_down", "func": command_cfg_execute_action_MouseWheelDown},
            {"name": "鼠标滚轮向上(大)", "command": "mouse_wheel_up_large", "func": command_cfg_execute_action_MouseWheelUpLarge},
            {"name": "鼠标滚轮向下(大)", "command": "mouse_wheel_down_large", "func": command_cfg_execute_action_MouseWheelDownLarge},
        ],
    },
    "SYSTEM-SHORTCUT" : [
        ("ctrl+c", "复制"),
        ("ctrl+v", "粘贴"),
        ("ctrl+x", "剪切"),
        ("ctrl+z", "撤销"),
        ("ctrl+y", "重做"),
        ("alt+tab", "切换窗口"),
        ("win+d", "显示桌面"),
        ("win+e", "打开文件资源管理器"),
        ("win+r", "运行"),
        ("win+l", "锁定计算机"),
        ("win+shift+s", "截图"),
        ("alt+f4", "关闭窗口"),
        ("win+space", "切换输入法"),
        ("win+i", "打开设置"),
        ("win+a", "打开通知中心"),
        ("win+x", "打开快速链接菜单"),
        ("win+tab", "任务视图"),
        ("win+数字键", "打开任务栏对应程序"),
        ("win+方向键", "调整窗口位置"),
        ("win+shift+方向键", "将窗口移动到其他显示器"),
    ],
    "USER-SHORTCUT" : [

    ]
}

#****************************************************************************************************
# Function Impletement
#***************************************************************************************************/


#****************************************************************************************************
# database_config_get()
#***************************************************************************************************/
def database_config_get():
    return GLOBAL_DATABASE

#****************************************************************************************************
# database_keys_get()
#***************************************************************************************************/
def database_keys_get():
    return GLOBAL_DATABASE["KEYS"]

#****************************************************************************************************
# database_actions_get()
#***************************************************************************************************/
def database_actions_get():
    return GLOBAL_DATABASE["ACTIONS"]

#****************************************************************************************************
# database_system_shortcut_get()
#***************************************************************************************************/
def database_system_shortcut_get():
    return GLOBAL_DATABASE["SYSTEM-SHORTCUT"]

#****************************************************************************************************
# database_user_shortcut_get()
#***************************************************************************************************/
def database_user_shortcut_get():
    return GLOBAL_DATABASE["USER-SHORTCUT"]

#****************************************************************************************************
# exports
#***************************************************************************************************/

#****************************************************************************************************
# File End!
#***************************************************************************************************/
